﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DIPLib.Filters
{
    public class ZoomIn
    {
        public static byte[] zeroOrder(byte[] rgbData, int width, int height, byte level)
        {
            MyBitmap bitmap = new MyBitmap(rgbData, width, height);
            byte[] rgbDataDes = new byte[rgbData.Length * level * level];
            MyBitmap bitmapDes = new MyBitmap(rgbDataDes, width * level, height * level);
            for (int i = 0; i < width; i++)
            {
                for (int j = 0; j < height; j++)
                {
                    byte gray = bitmap.getPixel(i, j);
                    int r = j * level;
                    int c = i * level;
                    for (int k = 0; k < level; k++)
                    {
                        for (int l = 0; l < level; l++)
                        {
                            bitmapDes.setPixel(c + l, r + k, gray);
                        }
                    }
                }
            }
            return rgbDataDes;
        }
    }
}
